<?php
include_once("clases/Conexion.php");
include_once("clases/MenuManager.php");

$link = new Conexion("localhost", "root", "root", "menues");
$objmenues = new MenuManager();
$array_menues = $objmenues->getMenu($_GET['id']);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <link href="css/style.css" rel="stylesheet" type="text/css"  />
        <script type="text/javascript" src="./js/jquery-latest.js"></script>
        <link rel="stylesheet" href="css/thickbox.css" type="text/css" />
        <script type="text/javascript" src="./js/thickbox.js"></script>
        <script type="text/javascript" src="./js/validarFormularioRubro.js"></script>
    </head>

    <body>
        <center>
            <fieldset>
                <legend>Editar Menú</legend>
                <form name="frmmenu" method="post" action="index.php?accion=update">
                    <input type="hidden" name="id" value="<?php echo $array_menues[0]['id'] ?>" />
                    <input type="hidden" name="tituloOld" value="<?php echo $array_menues[0]['titulo'] ?>" />
                    <label>titulo:</label><input type="text" id="titulo" name="titulo" value="<?php echo $array_menues[0]['titulo'] ?>" /><br />
                    <label>Color:</label><br/>
                    <select id="color" name="color">
                        <option value="blue"<?php if ($array_menues[0]['color'] == "blue") {
    echo "selected";
} ?>>Azul</option>
                        <option value="green"<?php if ($array_menues[0]['color'] == "green") {
    echo "selected";
} ?>>Verde</option>
                        <option value="orange"<?php if ($array_menues[0]['color'] == "orange") {
    echo "selected";
} ?>>Naranja</option>
                        <option value="red"<?php if ($array_menues[0]['color'] == "red") {
    echo "selected";
} ?>>Rojo</option>
                    </select><br/><br/>
                    <input type="button" name="btnregresar" value=":: REGRESAR ::" onclick="javascript:self.parent.tb_remove('R');" />
                    <input type="button" name="btngrabar" value=":: ACTUALIZAR ::" onclick="javascript:validarForm();"/><br/><br/>
                </form>
            </fieldset>
        </center>
    </body>
</html>